package com.yanqu.road.server.cmd.activity.feast;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ShanHeFeastProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.feast.CrossFeastMgr;
import com.yanqu.road.server.manager.activity.feast.activity.CrossFeastActivity;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_SHAN_HE_FEAST_GET_RANK_REWARD, desc = "领取排行榜奖励")
public class CrossFeastGetRankRewardCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        ShanHeFeastProto.CrossFeastGetRankRewardReqMsg reqMsg = ShanHeFeastProto.CrossFeastGetRankRewardReqMsg.parseFrom(packet.getBytes());
        CrossFeastActivity activity = CrossFeastMgr.getActivity(reqMsg.getActivityId());
        if (activity != null) {
            activity.getRankRewardByCmd(serverId, packet.getPlayerId(), reqMsg.getReq());
        }
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData() {

    }
}
